package com.javachmapi.springbootjsoup.demo;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * 相关方法 https://www.jianshu.com/p/ff9d40a4a356
 * @Description： create by 宋利军
 * 2020\5\29 00294:00
 */
public class LocalDateTest {

    public static void main(String[] args) {
        //获取昨天
        LocalDate zuotian = LocalDate.now().plusDays(-1);
        String zuotian1 = zuotian.format( DateTimeFormatter.BASIC_ISO_DATE);
        System.out.println("昨天:"+zuotian);
        //获取今天
        LocalDate jintian = LocalDate.now();
        System.out.println("今天:"+jintian);
        //获取明天
        LocalDate mingtian = LocalDate.now().plusDays(1);
        String mingtian1 = mingtian.format( DateTimeFormatter.BASIC_ISO_DATE);
        System.out.println("明天:"+mingtian);
        //获取某一天
        LocalDate localDate = LocalDate.of(2019, 1, 1);
        System.out.println();
        System.out.println();
        System.out.println();
        System.out.println();
        System.out.println();
        System.out.println();
        System.out.println();
        System.out.println();
        System.out.println();
        System.out.println();


    }
}
